package com.example.rpsm_property.mapper;

import com.example.rpsm_property.pojo.User;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    @Insert("insert into user value (NULL,#{account},#{password},#{idcard},#{username}," +
            "#{gender},#{age},#{user_type},#{user_status},#{user_roomid})")
    int insertUser(User user);
    Page<User> owners();

    @Update("update user set user_status = #{user_status} " +
            "where userid = #{userid}")
            int changeUserStatus(User user);
    @Select("select userid,username,account,idcard,gender,age,user_type,user_status,user_roomid from user where userid = #{id}")
            User queryById(int id);
}
